package com.jackstraw.jack_base.rules.service;

import com.jackstraw.jack_base.datasource.mybatis.base.service.MyBatisService;
import com.jackstraw.jack_base.rules.dao.database.RuleGroupDao;
import com.jackstraw.jack_base.rules.entity.bo.RuleGroupBo;
import com.jackstraw.jack_base.rules.entity.po.RuleGroupPo;
import com.jackstraw.jack_base.rules.entity.po.RuleGroupKeyPo;
import com.jackstraw.jack_base.rules.entity.po.RuleGroupPoExample;

import java.util.List;

/**
 * 规则组表  service接口
 *
 * @author zhaozhao 945514650@qq.com
 * @since version:1.0 generatorDate:2022-12-04 14:28:29
 */
public interface RuleGroupService
        extends MyBatisService<RuleGroupDao, RuleGroupPo, RuleGroupBo, RuleGroupKeyPo<RuleGroupPo>, RuleGroupPoExample> {


    /**
     * 查询场景主键对应的规则组
     *
     * @param sceneActuatorId 场景名称
     * @return
     */
    List<RuleGroupBo> queryAllRelationGroupsById(Long sceneActuatorId);


    /**
     * 通过规则组ID查询规则信息
     *
     * @param ruleGroupId
     * @return
     */
    RuleGroupBo queryOne(Long ruleGroupId);


    /**
     * 通过规则组ID查询规则信息，同时查询规则下对应的全局配置、导入的包以及规则
     *
     * @param ruleGroupId 规则组ID
     * @return
     */
    RuleGroupBo queryOneAll(Long ruleGroupId);


    /**
     * 查询规则组的最新版本
     * <p>
     * -1 数据不存在
     * -2 规则组失效
     *
     * @param ruleGroupId 规则组ID
     * @return
     */
    Integer queryGroupVersion(Long ruleGroupId);


}